<template>
  <div class="top-menu">
    <el-menu
      :default-active="activeIndex"
      class="el-menu-demo"
      mode="horizontal"
      @select="handleSelect"
      background-color="#545c64"
      text-color="#fff"
      active-text-color="#ffd04b"
    >
      <!-- <el-menu-item index="1">处理中心</el-menu-item> -->
      <el-submenu index="2">
        <template slot="title">设置</template>
        <el-menu-item index="2-1" @click="loginout">退出</el-menu-item>
      </el-submenu>
    </el-menu>
  </div>
</template>

<script>
export default {
  data() {
    return {
      activeIndex: "1",
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      console.log(key, keyPath);
    },
    loginout() {
      sessionStorage.removeItem("isLogin");
      sessionStorage.removeItem("token");
      this.$router.push("/login");
    },
  },
};
</script>

<style>
</style>